namespace Org.Loon.Framework.Xna.Game.Action.Sprite
{

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Org.Loon.Framework.Xna.Game.Core;

    public class Mask : LRelease
    {

        private int height;

        private int width;

        private bool[][] data;

        public Mask(int w, int h)
        {
            this.width = w;
            this.height = h;
        }

        public Mask(bool[][] d, int w, int h)
        {
            this.data = d;
            this.width = w;
            this.height = h;
        }

        public bool[][] GetData()
        {
            return data;
        }

        public bool GetPixel(int x, int y)
        {
            if (x < 0 || x >= width || y < 0 || y >= height)
            {
                return false;
            }
            return data[y][x];
        }

        public void SetData(bool[][] d)
        {
            this.data = d;
        }

        public int GetWidth()
        {
            return width;
        }

        public int GetHeight()
        {
            return height;
        }

        public virtual void Dispose()
        {
            if (data != null)
            {
                data = null;
            }
        }

    }
}
